import request from 'umi-request';

export async function getEducationInfo(id) {
  return request(`/hr-ssc/api/api-admin/member/getEducationInfo/${id}`, {
    method: 'get',
  }).then((res) => {
    return res.data;
  });
}

export async function saveEducationInfo(data) {
  return request(`/hr-ssc/api/api-admin/member/saveEducationInfo`, {
    method: 'post',
    data: {...data}
  }).then((res) => {
    return res;
  });
}

export async function updateEducationInfo(data) {
  return request(`/hr-ssc/api/api-admin/member/updateEducationInfo`, {
    method: 'post',
    data: {...data}
  }).then((res) => {
    return res;
  });
}

export async function deleteEducation(id) {
  return request(`/hr-ssc/api/api-admin/member/deleteEducation/${id}`, {
    method: 'get',
  }).then((res) => {
    return res;
  });
}

export async function getInorgInfo(empoid) {
  return request(`/hr-ssc/api/api-admin/member/getInorgInfo/${empoid}`, {
    method: 'get',
  }).then((res) => {
    return res.data;
  });
}

export async function saveInorgInfo(data) {
  return request(`/hr-ssc/api/api-admin/member/saveInorgInfo`, {
    method: 'post',
    data: {...data}
  }).then((res) => {
    return res;
  });
}

export async function updateInorgInfo(data) {
  return request(`/hr-ssc/api/api-admin/member/updateInorgInfo`, {
    method: 'post',
    data: {...data}
  }).then((res) => {
    return res;
  });
}

export async function deleteInorg(id) {
  return request(`/hr-ssc/api/api-admin/member/deleteInorg/${id}`, {
    method: 'get',
  }).then((res) => {
    return res;
  });
}

export async function getFamily(id) {
  return request(`/hr-ssc/api/api-admin/member/getFamily/${id}`, {
    method: 'get',
  }).then((res) => {
    return res.data;
  });
}

export async function saveFamily(data) {
  return request(`/hr-ssc/api/api-admin/member/saveFamily`, {
    method: 'post',
    data: {...data}
  }).then((res) => {
    return res;
  });
}

export async function updateFamily(data) {
  return request(`/hr-ssc/api/api-admin/member/updateFamily`, {
    method: 'post',
    data: {...data}
  }).then((res) => {
    return res;
  });
}

export async function deleteFamily(id) {
  return request(`/hr-ssc/api/api-admin/member/deleteFamily/${id}`, {
    method: 'get',
  }).then((res) => {
    return res;
  });
}

export async function getSociety(id) {
  return request(`/hr-ssc/api/api-admin/member/getSociety/${id}`, {
    method: 'get',
  }).then((res) => {
    return res.data;
  });
}

export async function saveSociety(data) {
  return request(`/hr-ssc/api/api-admin/member/saveSociety`, {
    method: 'post',
    data: {...data}
  }).then((res) => {
    return res;
  });
}

export async function updateSociety(data) {
  return request(`/hr-ssc/api/api-admin/member/updateSociety`, {
    method: 'post',
    data: {...data}
  }).then((res) => {
    return res;
  });
}

export async function deleteSociety(id) {
  return request(`/hr-ssc/api/api-admin/member/deleteSociety/${id}`, {
    method: 'get',
  }).then((res) => {
    return res;
  });
}
